//数据回填
function renderUser() {
    $.ajax({
        url: '/my/user/userinfo',
        success: function (res) {
          
            let form = layui.form
            form.val('abc',res.data)
        }
    })
}
renderUser()
//更改用户信息
$('form').on('submit', function (e) {
    e.preventDefault()
    let data = $(this).serialize()
    $.ajax({
        type:'POST',
        url: '/my/user/userinfo',
        data: data,
        success: function (res) {
            if (res.status === 0) {
                layer.msg('修改成功')
                window.parent.getUserinfo()
            }
           
        }
    })
})
//重置功能
$('button[type=reset]').on('click', function () {
    renderUser()
})